package com.example.houduan.Mapper;

import com.example.houduan.Pojo.Sale;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SaleMapper {

    @Select("select count(*) from sale ")
    int selectSaleCount();

    List<Sale> selectSaleLimit(int b,int e);

    @Delete("delete from sale where sale_id=#{sale_id}")
    int deleteSale(Integer sale_id);

    @Update("update sale set sale_name=#{sale_name},sale_phone=#{sale_phone},latitude=#{latitude},longitude=#{longitude},city_id=#{city.city_id} where sale_id=#{sale_id}")
    int updateSale(Sale sale);

    @Insert("insert into sale values (#{sale_id},#{sale_name},#{sale_phone},#{createtime},#{updatetime},#{latitude},#{longitude},#{city.city_id})")
    int insertSale(Sale sale);

    List<Sale> selectSaleByConditions(Integer sale_id,String sale_name,String city_name);
}
